
local cnt = 1

function event_cb( e )

	print( "Clicked" )

	local btn = lv.event_get_target( e );

	local label = lv.obj_get_child( btn, 0 );

	lv.label_set_text( label, string.format( "%d", cnt ) );

	cnt = cnt + 1
end

local btn = lv.btn_create( lv.scr_act() );

lv.obj_set_size( btn, 100, 50 );

lv.obj_center( btn );

lv.obj_add_event_cb( btn, lv.LV_EVENT_CLICKED, event_cb );

local label = lv.label_create( btn );

lv.label_set_text( label, "Click me!" );

lv.obj_center( label );
